package com.xiaoyu.awakening.ai.search.config.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.List;

/**
 * 搜索配置
 *
 * @author wangxiaoyu
 * @date 2025/8/6 16:35
 * @since v1.0
 */
@Data
@Configuration
@ConfigurationProperties(prefix = AwkSearchConfigProperties.AWK_AI_SEARCH)
public class AwkSearchConfigProperties {
    public static final String AWK_AI_SEARCH = "awk.search";
    public static final String AWK_AI_SEARCH_INTENTION = "awk.search.intention";
    public static final String AWK_AI_SEARCH_PLAN = "awk.search.plan";
    public static final String AWK_AI_SEARCH_RERANK = "awk.search.rerank";
    public static final String AWK_AI_SEARCH_CALLBACK = "awk.search.callback";

    private IntentionProperties intentionProperties;
    private PlanProperties planProperties;
    private RerankProperties rerankProperties;
    private CallbackProperties callbackProperties;

    @Data
    @Configuration
    @ConfigurationProperties(prefix = AwkSearchConfigProperties.AWK_AI_SEARCH_INTENTION)
    public static class IntentionProperties {
        private Long shortQueryNum;
        private Long longQueryNum;
        private Integer extendQueryNum;
        private Boolean enableNormalized;
        private Boolean enableExtendFromHistory;
        private Integer extendFromHistoryNum;
        private Boolean enableBalanceMode;
        private Integer intentionChooseNum;
    }

    @Data
    @Configuration
    @ConfigurationProperties(prefix = AwkSearchConfigProperties.AWK_AI_SEARCH_PLAN)
    public static class PlanProperties {
    }

    @Data
    @Configuration
    @ConfigurationProperties(prefix = AwkSearchConfigProperties.AWK_AI_SEARCH_RERANK)
    public static class RerankProperties {
        private List<String> enableRerankHandlers;
        private Float semanticWeight;
        private Float businessWeight;
        private Float modelWeight;
        private Float keywordWeight;
    }

    @Data
    @Configuration
    @ConfigurationProperties(prefix = AwkSearchConfigProperties.AWK_AI_SEARCH_CALLBACK)
    public static class CallbackProperties {
        private String callback;
    }

}

